var __BASE = { is_weixin: function is_weixin() { var ua = navigator.userAgent.toLowerCase(); if (ua.match(/MicroMessenger/i) == "micromessenger") { return true; } else { return false; } }, getqs: function getqs(name) { var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i"); var r = window.locations.search.substr(1).match(reg); if (r != null) return decodeURIComponent(r[2]); return ''; }, //删除url中某个参数 urlDelP: function(url,name){ var urlArr = url.split('?'); if(urlArr.length>1 && urlArr[1].indexOf(name)>-1){ var query = urlArr[1]; var obj = {} var arr = query.split("&"); for (var i = 0; i < arr.length; i++) { arr[i] = arr[i].split("="); obj[arr[i][0]] = arr[i][1]; }; delete obj[name]; var p = JSON.stringify(obj).replace(/[\"\{\}]/g,"").replace(/\:/g,"=").replace(/\,/g,"&") if(p==''){ return urlArr[0] }else{ return urlArr[0] +'?'+ p; } }else{ return url; }; }, deleteCookie: function deleteCookie(name,path='/') { document.cookie = name + '=; expires=Thu, 01 Jan 1970 00:00:01 GMT; path='+path; }, addCookie: function addCookie(objName, objValue, objHours) { //添加cookie var str = objName + "=" + decodeURIComponent(objValue); if (objHours > 0) { //为0时不设定过期时间,浏览器关闭时cookie自动消失 var date = new Date(); var ms = objHours * 3600 * 1000; date.setTime(date.getTime() + ms); str += "; expires=" + date.toGMTString() + "; path=/"; } document.cookie = str; }, getCookie: function getCookie(objName) { //获取指定名称的cookie的值 const regexString = `(?:(?:^|.*;\\s*)${objName}\\s*\\=\\s*([^;]*).*$)|^.*$`; // 构建包含变量的正则表达式字符串 const regex = new RegExp(regexString); // 创建正则表达式对象 return document.cookie.replace(regex, "$1"); }, baseDataURI: window.locations.origin + window.locations.pathname, height: window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight, //高度计算太早有些时候可能会有问题 data: {}, sysInfo: { isioses: !!navigator.userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/), isiphoness: navigator.userAgent.toLowerCase().indexOf('iphoness') >= 0 }, loadImage: function loadImage(url) { return new Promise(function (resolve, reject) { var img = new Image(); img.onload = function () { resolve(img); }; img.src = url; }); }, /* x = new laoding([],[],onprocess(ex),callback) */ loading: function loading(_before, _end, _on, _callback, _beforecallback) { var _this = this; _this.queue = new createjs.LoadQueue(); _this.queue.on("complete", function () { _beforecallback && _beforecallback(); _this._mainLoading(); }, this); _this.queue.loadManifest(_before); _this._mainLoading = function () { _this.mainLoadingQueue = new createjs.LoadQueue(); _this.mainLoadingQueue.on("complete", function () { _callback && _callback(); }, this); _this.mainLoadingQueue.on("progress", function (ex) { var _pro = parseInt(ex.progress * 100); _on(_pro); }, this); _this.mainLoadingQueue.loadManifest(_end); }; _this.un = function (sel) { $('' + sel + ' img[data-src]').each(function (index, el) { $(this).attr('src', $(this).attr('data-src')); }); }; return _this; }, loadingState: { on: function on() { if ($('.J_ajaxLoading').length > 0) { $('.J_ajaxLoading').show(); } else { $("
")).appendTo('body').show(); } }, off: function off() { $('.J_ajaxLoading').hide(); } }, loadingState1: { on: function on() { if ($('.J_ajaxLoading1').length > 0) { $('.J_ajaxLoading1').show(); } else { $("
").appendTo('body').show(); } }, off: function off() { $('.J_ajaxLoading1').hide(); } }, addJwt: function addJwt(jwt) { $.ajaxSetup({ // global:false, headers: { Authorization: jwt } }); }, alert: function alert(text) { if ($('.J_alert').length > 0) { $('.alert_text').html(text); $('.J_alert').fadeIn(); } else { $("
").concat(text, "
\u786E\u5B9A
")).appendTo('body').fadeIn(); $('.alert_btn').bind('click', function (event) { $('.J_alert').fadeOut(); }); } }, /* x = new ajaxAction({ dataURL // type // post or get }); x.send({},callback(result),att) // att ('adduser') */ ajaxAction: function ajaxAction(opt) { var that = this; this.baseURI = opt.dataURL; this.type = opt.type || 'POST'; that.tracking = {}; that.installTracking = function () { var tracking = {}; tracking.utm_source = __BASE.getqs('utm_source'); tracking.utm_campaign = __BASE.getqs('utm_campaign'); tracking.utm_medium = __BASE.getqs('utm_medium'); tracking.hmsr = __BASE.getqs('hmsr'); tracking.hmpl = __BASE.getqs('hmpl'); tracking.hmcu = __BASE.getqs('hmcu'); tracking.hmkw = __BASE.getqs('hmkw'); tracking.hmci = __BASE.getqs('hmci'); tracking.utm_source_level = parseInt(__BASE.getqs('utm_source_level') || 0); if (isNaN(tracking.utm_source_level)) { tracking.utm_source_level = 0; } tracking.utm_source_level = tracking.utm_source_level + 1; that.tracking = tracking; }; that.send = function (actionData, callback, att) { var _enddata = $.extend(actionData, that.tracking); $.ajax({ type: that.type, url: that.baseURI + att, cache: false, dataType: "json", data: _enddata, success: function success(result) { callback(result); }, error: function error(e) { try {} catch (e) {} callback({ "state": false }); } }); }; that.installTracking(); return this; } }; var _hmsr = __BASE.getqs('hmsr') var _utm_source = __BASE.getqs('utm_source') var _gaid = '' if(_hmsr==''){ _hmsr = 'wap'; } if(_utm_source==''){ _utm_source = 'wap'; } _trackEvent = { sendEvent:function(v){ try{ _hmt.push(['_trackEvent', _hmsr, 'click', v,'']); console.log('BaiduEvent:'+v); }catch(e){} try{ stm_clicki('send', 'event', _hmsr, 'click', v, ''); console.log('MZEvent:'+v); }catch(e){} if(window.ga){ gtag('event', v, { 'event_category': _utm_source, }); console.log('GaEvent:'+v+' -> send success'); } }, sendPv:function(StrPageLink,t){ try{ _hmt.push(['_trackPageview', '/'+StrPageLink]); console.log('BaiduPageView:'+StrPageLink+' -> send success'); }catch(e){} if(window.ga){ ga('send', 'pageview', '/'+StrPageLink); console.log('GaPageView:'+StrPageLink+' -> send success'); } try{ stm_clicki('send', 'pageview', {'page': '/'+StrPageLink, 'title': t}); console.log('MZPageView:'+StrPageLink+' -> send success'); }catch(e){} } } $(function(){ var windowW = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth var _resize = function () { windowW = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth } window.onresize = function () { _resize(); }; _resize(); function orientationChange() { switch (window.orientation) { case 0: // Portrait case 180: // Upside-down Portrait //locations.reload(true); setTimeout(function () { _resize(); }, 200); break; case -90: // Landscape: turned 90 degrees counter-clockwise case 90: // Landscape: turned 90 degrees clockwise break; } } window.addEventListener("onorientationchange" in window ? "orientationchange" : "resize", orientationChange, false); fade = { fadeIn: function (sel, cb) { $(sel).fadeIn(400); cb && cb(); }, fadeOut: function (sel, cb) { $(sel).fadeOut(200); } }; $('*[data-show]').on('click', function (event) { var _dir = $(this).attr('data-show'); fade.fadeIn(_dir); }); $('*[data-hide]').bind('click', function (event) { var _dir = $(this).attr('data-hide'); fade.fadeOut(_dir); }); $('*[data-tracking]').bind('click', function(event) { var _val = $(this).attr('data-tracking'); _trackEvent.sendEvent(_val); }); // $('a').on('click',function(){ // let _href = $(this).attr('data-href'); // let _val = $(this).attr('data-href-tracking'); // setTimeout(function(){ // _trackEvent.sendEvent(_val); // locations.href = _href; // },150); // }); // 微信自定义分享: // 标题:20字以内 // 描述:25字以内 // 图片:300*300 // var _share = new shareApi({ // baseURI:window.locations.href, // title:'test', // desc:'test', // timeline:'test', // img:'http://test.sact-digital.cn/reymond/test/images/share.jpg', // onInit:function(){ // }, // messageSuccess:function(){ _trackEvent.sendEvent('messageSuccess'); }, // messageCancel:function(){ _trackEvent.sendEvent('messageCancel'); }, // timelineSuccess:function(){ _trackEvent.sendEvent('timelineSuccess'); }, // timelineCancel:function(){ _trackEvent.sendEvent('timelineCancel'); } // }); ajax = new __BASE.ajaxAction({ dataURL:__BASE.baseDataURI, type:'POST' }); var baseInfo = { pageInTween: null, headerTimer: null, startPos: 0, endPos: 0, canM: false, scrollTop: window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop, pageHeight: window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight, bodyHeight:$('body').height(), leftScrollWrap:$('.left_scroll_wrap'), hasproductBtnTime: false, productBtnTime: null, hasseriesFeaturesText2Time: false, seriesFeaturesText2Time: null, onscrollFun:null, marketTrendsTime:false, globalCaseTime:false, marketTrends:document.querySelector('#marketTrends'), marketTrendsToTop: 0, relatedProducts:document.querySelector('.relatedProducts'), relatedProductsToTop: 0, // solutionPart:document.querySelector('#solutionPart'), // solutionPartToTop: 0, // globalCase:document.querySelector('#globalCase'), // globalCaseToTop: 0, // seriesFeaturesPart:document.querySelector('.seriesFeaturesPart'), // seriesFeaturesPartToTop: 0, // pageLRTwo:document.querySelector('.pageLRTwo'), // pageLRTwoToTop: 0, // pageSwiper:document.querySelector('.pageSwiper'), // pageSwiperToTop: 0, numUpTime: null, numUpFun:function (id,start,end) { // baseInfo.numUpTime if(start0&&baseInfo.scrollTop<800){ // $(".bannerText1,.bannerText2").css("transform",`translateY(-${baseInfo.scrollTop/4}px)`) // $(".bannerImg img").css("transform",`translateY(${baseInfo.scrollTop/1.2>800?800:baseInfo.scrollTop/8}px)`) // } // $(".bannerText1,.bannerText2").css("transform",`translateY(-${baseInfo.scrollTop/4}px)`) $(".bannerTextWrap").css("margin-top",`-${baseInfo.scrollTop/4}px`) $(".bannerVideo video").css("transform",`translateY(${baseInfo.scrollTop/8}px)`) //marketTrends文字出现动画 if(baseInfo.marketTrendsToTop baseInfo.endPos) { // console.log("向下滚动,头部显示"); // $('.header').css("transform","translateY(0)") // $('.header').addClass('headerAct') // } else if (baseInfo.startPos < baseInfo.endPos) { // console.log("向上滚动,头部隐藏"); // $('.header').css("transform","translateY(-100%)") // $('.header').removeClass('headerAct') // } else { // console.log("未滚动"); // } // if(baseInfo.endPos == 0){ // $('.header').removeClass('headerAct') // } // // 滑动结束将startPos复原null // baseInfo.startPos = null // }, 100) // solutionPart // console.log(baseInfo.solutionPartToTop) // if(baseInfo.solutionPartToTop<0){ // // 2000为解决方案3个part总宽度 // let d = baseInfo.solutionPartToTop<=-2000?-2000:baseInfo.solutionPartToTop // let s = -baseInfo.solutionPartToTop/2000*100>=30?30:-baseInfo.solutionPartToTop/2000*100 // document.querySelector('.solutionList').style.transform = "translate(-"+s+"%,0px)" // } // if(document.querySelector('#marketTrends').getBoundingClientRect().top-1>0){ // $('.left_scroll_wrap').hide() // // $('.left_scroll_wrap').removeClass('left_scroll_wrap_white') // }else if(document.querySelector('#marketTrends').getBoundingClientRect().top-1<0 && document.querySelector('#pageCompanyNotice').getBoundingClientRect().top-1>0){ // $('.left_scroll_wrap').show() // $('.left_scroll_item').removeClass('act') // $('.marketTrends_item').addClass('act') // // $('.left_scroll_wrap').removeClass('left_scroll_wrap_white') // }else if(document.querySelector('#pageCompanyNotice').getBoundingClientRect().top-1<0 && document.querySelector('#contactContent').getBoundingClientRect().top-1>0){ // $('.left_scroll_wrap').show() // $('.left_scroll_item').removeClass('act') // $('.pageCompanyNotice_item').addClass('act') // // $('.left_scroll_wrap').removeClass('left_scroll_wrap_white') // }else if(document.querySelector('#contactContent').getBoundingClientRect().top-1<0 ){ // $('.left_scroll_wrap').show() // $('.left_scroll_item').removeClass('act') // $('.contactContent_item').addClass('act') // // $('.left_scroll_wrap').removeClass('left_scroll_wrap_white') // } // 左边列表跟随滑动 // var leftScrollT = (baseInfo.scrollTop-$('.left_scroll')[0].getBoundingClientRect().height)/(baseInfo.bodyHeight-baseInfo.pageHeight)*80 // $('.left_scroll,.left_scroll_s').css({"top":`${leftScrollT>80?80:leftScrollT}%`}) //foot // 获取目标div的位置 // const scrollPosition = $(window).scrollTop(); // const scrollY = window.scrollY; // const windowHeight = window.innerHeight; // const documentHeight = document.documentElement.scrollHeight; // const footerToTop = document.querySelector('.footer_other').getBoundingClientRect().top // const footerTop = documentHeight - 753; // if(footerToTop=-100){ // const scrollPercentage = (scrollPosition / (documentHeight - windowHeight)) * 100; // // 判断滚动方向 // let opacity = 0; // const maxTranslate = 140; // 最大translate值 // let translateY = maxTranslate - (scrollY + windowHeight - footerTop); // translateY = Math.max(0, Math.min(maxTranslate, translateY)); // $('.footer').css({ // 'opacity': '1' // }); // if (scrollPosition > lastScrollTop) { // // 下滑 // translateY = 140 - (scrollPercentage * 1); // 每滚动 1%,Y 轴移动 1px // opacity = scrollPercentage / 100; // 每滚动 1%,透明度增加 1% // $('.footer .container').css({ // 'opacity': opacity, // 'transform':`translate3d(0, ${translateY}px, 0)` // }); // } else { // // 上滑 // translateY -= -(scrollPercentage * 1); // 每滚动 1%,Y 轴移动 1px // opacity = 1 - (scrollPercentage / 100)*0.4; // 每滚动 1%,透明度减少 1% // $('.footer .container').css({ // 'opacity': opacity, // 'transform':`translate3d(0, ${translateY}px, 0)` // }); // } // } else { // $('.footer').css({ // 'opacity': '0' // }); // } // // 更新 lastScrollTop // lastScrollTop = scrollPosition; } baseInfo.onscrollFun() window.onscroll = function (){baseInfo.onscrollFun()} var previousScrollTop = 0; document.addEventListener('scroll', function() { var scrollTop = document.documentElement.scrollTop || document.body.scrollTop; if (scrollTop > previousScrollTop) { $('.header-20241125,.header-20241125-wap').css("transform","translateY(-100%)") $('.header-20241125').removeClass('headerAct-20241125') $('.header-20241125-wap').removeClass('headerAct-20241125-wap') } else { $('.header-20241125,.header-20241125-wap').css("transform","translateY(0)") $('.header-20241125').addClass('headerAct-20241125') $('.header-20241125-wap').addClass('headerAct-20241125-wap') } if(scrollTop == 0){ $('.header-20241125').removeClass('headerAct-20241125') $('.header-20241125-wap').removeClass('headerAct-20241125-wap') } previousScrollTop = scrollTop; }); $('.left_scroll_item').bind('click',function () { var _id = $(this).data("id") document.querySelector('#'+_id).scrollIntoView({behavior:"smooth"}) }) $('#photovoltaicArr').bind('click',function () { if(baseInfo.hasphotovoltaic){ baseInfo.hasphotovoltaic = false $('.photovoltaicRightWrap').removeClass("act") }else{ baseInfo.hasphotovoltaic = true $('.photovoltaicRightWrap').addClass("act") } }) $(".solutionItem").mouseenter(function(){ let _id = $(this).data("id") //2000为css中设置的总宽度 if(_id == 0){ $('.solutionScrollWrap').css({"left":"0"}) document.querySelector('.solutionList').style.transform = "translate(5%,0px)" }else if(_id == 1){ $('.solutionScrollWrap').css({"left":"33.33%"}) document.querySelector('.solutionList').style.transform = "translate(-"+(2000-windowW)/2+"px,0px)" }else if(_id == 2){ $('.solutionScrollWrap').css({"left":"66.66%"}) document.querySelector('.solutionList').style.transform = "translate(-"+(2000-windowW)+"px,0px)" } }); // $('.J_globalCasePrev').bind('click',function () { // let _div = $('.imgList')[2] // $('.imgListWrap').prepend(_div); // $($('.imgList')[0]).addClass("act") // setTimeout(function () { // $('.imgList').removeClass("act") // },500) // }) // $('.J_globalCaseNext').bind('click',function () { // let _div = $('.imgList')[0] // $($('.imgList')[0]).addClass("act") // setTimeout(function () { // $('.imgList').removeClass("act") // $('.imgListWrap').append(_div); // },500) // }) // $('.solutionItem').bind('mouseover',function() { // }) bannerSwiper = new Swiper('.bannerSwiper',{ loop: false, // 循环模式选项 direction: 'horizontal', autoplay:true, navigation: { nextEl: '.bannerArrR', prevEl: '.bannerArrL', }, pagination: { el: '.bannerPagination', clickable :true, }, }); // console.log("执行1") // var mySwiper = new Swiper ('#swiper1', { // speed:1500, // autoplay:{ // delay:5000 // }, // direction: 'horizontal', // 垂直切换选项 // loop: true, // 循环模式选项 // // spaceBetween: 5, // slidesPerView: 'auto', // centeredSlides: true, // // allowTouchMove: false, // // 如果需要分页器 // pagination: { // el: '.swiper-pagination', // clickable:true // }, // // 如果需要前进后退按钮 // navigation: { // nextEl: '.swiper-button-next1', // prevEl: '.swiper-button-prev1', // }, // on: { // slideChange: function(){ // // console.log('改变了,activeIndex为'+this.activeIndex,'--->mySwiper.realIndex--',this.realIndex); // }, // } // }) //考虑加节流防抖 //屏幕高度 // ===图片 + 文字 pageLRTwo=== // let clock_flag_pageLRTwo =false // let pageLRTwo1 = document.querySelector("#pageLRTwo1") // window.addEventListener('scroll', function() { // // console.log('页面滚动中'); // // 在这里执行你想要的操作 // let top = pageLRTwo1.getBoundingClientRect().top // // console.log('pageLRTwo1-->',top) // if(top<=200){ // if(clock_flag_pageLRTwo == '1'){ // return // } // clock_flag_pageLRTwo='1' // ani_pageLRTwo() // } // if(top>=window.innerHeight){ // if(clock_flag_pageLRTwo == '2'){ // return // } // clock_flag_pageLRTwo='2' // ani_pageLRTwo_revert() // } // }); // function ani_pageLRTwo(){ // $(".pageLRTwo").css("opacity",1) // // $(".pageLRTwo .imgv").css("opacity",1) // // $(".pageLRTwo .txts").css("opacity",1) // $(".pageLRTwo .txts").css("transform","translateY(0)") // setTimeout(function(){ // $(".pageLRTwo .txts .desc").css("transform","translateY(0)") // // },1000*0.4) // },1000*0.3) // } // function ani_pageLRTwo_revert(){ // $(".pageLRTwo").css("opacity",0.3) // // $(".pageLRTwo .imgv").css("opacity",0) // // $(".pageLRTwo .txts").css("opacity",0) // $(".pageLRTwo .txts").css("transform","translateY(30px)") // // setTimeout(function(){ // $(".pageLRTwo .txts .desc").css("transform","translateY(30px)") // // },1000*0.4) // // },1000*0.3) // } //3个版块那 // let clock_flag_pageThreeM =false // let pageThreeM1 = document.querySelector("#pageThreeM1") // window.addEventListener('scroll', function() { // // console.log('页面滚动中'); // // 在这里执行你想要的操作 // let top = pageThreeM1.getBoundingClientRect().top // // console.log('pageThreeM1-->',top) // if(top<=300){ // if(clock_flag_pageThreeM == '1'){ // return // } // clock_flag_pageThreeM= '1' // ani_pageThreeM() // } // if(top>=window.innerHeight){ // if(clock_flag_pageThreeM == '2'){ // return // } // clock_flag_pageThreeM='2' // ani_pageThreeM_revert() // } // }); // function ani_pageThreeM(){ // $(".pageThreeM").css("opacity",1) // // $(".pageThreeM .info").css("opacity",1) // $(".pageThreeM .tit").css("transform","translateY(0)") // setTimeout(function(){ // $(".pageThreeM .desc").css("transform","translateY(0)") // // },1000*0.2) // },1000*0.2) // } // function ani_pageThreeM_revert(){ // $(".pageThreeM").css("opacity",0.3) // // $(".pageThreeM .info").css("opacity",0) // $(".pageThreeM .tit").css("transform","translateY(30px)") // $(".pageThreeM .desc").css("transform","translateY(30px)") // } //======================= a js start ================ // 创新研发 // window.addEventListener('scroll', function() { // pageFullImgAni('#pageFullImg1') // pageFullImgAni('#pageFullImg2') // pageFullImgAni('#pageFullImg3') // pageSolarAni("#pageSolar") // pageEcologyAni("#pageEcology") // }) function pageFullImgAni(id){ let dom = document.querySelector(id) if(dom){ let top = dom.getBoundingClientRect().top // console.log(top) if(top<=300){ $(id +" .videomask").css("opacity","1") $(id +" .desc").css("opacity","1") $(id +" .desc").css("transform","translateY(0)") setTimeout(function(){ $(id +" .txts").css("opacity","1") $(id +" .txts").css("transform","translateY(0)") },300) setTimeout(function(){ $(id +" .btn").css("opacity","1") $(id +" .btn").css("transform","translate(-50%,0)") },600) } if(top<=0){ //裁剪 缩小动画 $(id).addClass("pageMin") } } } function pageSolarAni(id){ let dom = document.querySelector(id) if(dom){ let top = dom.getBoundingClientRect().top // console.log(top) if(top<=250){ $(id +" .tit").css("opacity","1") $(id +" .tit").css("transform","translateY(0)") setTimeout(function(){ $(id +" .desc").css("opacity","1") $(id +" .desc").css("transform","translateY(0)") },200) setTimeout(function(){ $(id +" .btn").css("opacity","1") $(id +" .btn").css("transform","translateY(0)") },400) setTimeout(function(){ $(id +" .solar-list").css("opacity","1") $(id +" .solar-list").css("transform","translateY(0)") },800) } } } //产品生态 $("#pageEcology .info").on("mouseenter",function(){ $(this).css("width", '58.99%' ) $(this).siblings('.info').css("width",'20%') }) $("#pageEcology .infos").on("mouseleave",function(){ $("#pageEcology .info").css("width",'33.33%') }) function pageEcologyAni(id){ let dom = document.querySelector(id) if(dom){ let top = dom.getBoundingClientRect().top // console.log(top) if(top<=300){ $(id +" .infos").css("opacity","1") $(id +" .infos").css("transform","translateY(0)") setTimeout(function(){ $(id +" .txts").css("opacity","1") $(id +" .txts").css("transform","translateY(0)") $(id +" .btn").css("opacity","1") $(id +" .btn").css("transform","translate(-50%,0)") },300) } } } // //公司公告 let pageCompanyNotice_active_idx = 2-1 $(".pageCompanyNotice .num").on("click",function(){ pageCompanyNotice_active_idx = $(this).index() $(this).addClass("active").siblings(".num").removeClass("active") }) $(".pageCompanyNotice .left").on("click",function(){ pageCompanyNotice_active_idx-- if(pageCompanyNotice_active_idx<0){ return } $(".pageCompanyNotice .num").eq(pageCompanyNotice_active_idx).addClass("active").siblings(".num").removeClass("active") }) $(".pageCompanyNotice .right").on("click",function(){ pageCompanyNotice_active_idx++ if(pageCompanyNotice_active_idx>7){ return } $(".pageCompanyNotice .num").eq(pageCompanyNotice_active_idx).addClass("active").siblings(".num").removeClass("active") }) $(".pageCompanyNotice .filters2 .btn").on("click",function(){ $(this).addClass("active").siblings(".btn").removeClass("active") }) // window.addEventListener('scroll', function() { // pageCompanyNoticeAni() // }) // function pageCompanyNoticeAni(){ // let dom = document.querySelector('.pageCompanyNotice') // if(dom){ // let top = dom.getBoundingClientRect().top // if(top<300){ // $(".pageCompanyNotice .list").eq(0).addClass("act") // setTimeout(()=>{ // $(".pageCompanyNotice .list").eq(1).addClass("act") // },300) // setTimeout(()=>{ // $(".pageCompanyNotice .list").eq(2).addClass("act") // },600) // setTimeout(()=>{ // $(".pageCompanyNotice .list").eq(3).addClass("act") // },900) // } // } // } //=======================a js end ================ $('.left_scroll_item').bind('click',function () { var _id = $(this).data("id") switch(_id){ case "videoPart": baseInfo.videoPart.scrollIntoView({behavior:"smooth"}) break; case "seriesFeaturesPart": baseInfo.seriesFeaturesPart.scrollIntoView({behavior:"smooth"}) break; case "relatedProducts": baseInfo.relatedProducts.scrollIntoView({behavior:"smooth"}) break; case "pageSwiper": baseInfo.pageSwiper.scrollIntoView({behavior:"smooth"}) break; default:break; } }) // ------------------------------------------ // var newsSwiper = new Swiper ('#news_swiper', { // speed:1500, // autoplay:{ // delay:1500, // disableOnInteraction: false, // }, // direction: 'horizontal', // 垂直切换选项 // loop: true, // 循环模式选项 // // spaceBetween: 5, // slidesPerView: 'auto', // centeredSlides: true, // }) // ------------------------------------------ // window.addEventListener('scroll', function() { // pageContactTxtAni('#contactContent') // }) // function pageContactTxtAni(id){ // let dom = document.querySelector(id) // if(dom){ // let top = dom.getBoundingClientRect().top // if(top<0){ // $(`${id} .contact_desc`).css("transform",`translateY(${top/4}px)`) // } // //文字出现动画 // if(top<400){ // $(`${id}`).css("opacity",1) // $(`${id} .txt`).addClass('act') // setTimeout(function () { // $(`${id} .tip`).addClass('act') // },300) // }else{ // $(`${id} .txt,${id} .tip`).removeClass('act') // } // } // } window.addEventListener('scroll', function() { scrollCommon({el:'#pageCompanyNotice .tit', h:100 , child:{el:'#pageCompanyNotice .filters' }}) scrollCommon({el:'#pageCompanyNotice .list1',h:102}) scrollCommon({el:'#pageCompanyNotice .list2',h:106}) scrollCommon({el:'#pageCompanyNotice .list3',h:110}) scrollCommon({el:'#pageCompanyNotice .list4',h:114}) scrollCommon({el:'#pageCompanyNotice .button-more',h:118}) }) window.addEventListener('scroll', function() { scrollCommon({el:'#contactContent .contact_title',h:100}) scrollCommon({el:'#contactContent .contact_desc',h:110,child:{el:'#contactContent .txt'}}) scrollCommon({el:'#contactContent .tip',h:115}) }) $('.pageCompanyNotice .list').bind('click',function(){ $('.pageCompanyNotice .list').css('box-shadow', 'none'); $('.pageCompanyNotice .list').find('.right .imgv .download1').css('opacity',0) $(this).css({'box-shadow':'3px 3px 10px #98d0f9'}) $(this).find('.right .imgv .download1').css('opacity',1) }) });